home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_04_shw_cinematic_3.cog < prev    next >
Text File  |  1999-11-15  |  15KB  |  586 lines

  1. # Jones 3D Cog Script
  2. #
  3. # 04_SHW_Cinematic_3.cog
  4. #
  5. # Holy Woman directs Indy toward Palawan 
  6. #
  7. # [HB] effects added by Chris McGee
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ===================================================================
  12.  
  13. symbols
  14.  
  15. # **************************** MESSAGES *****************************
  16.  
  17.     message        startup
  18.     message        activated
  19.     message        arrived
  20.     message        timer
  21.     message        callback
  22.     message        pulse
  23.     
  24. # **************************** KEYFRAMES ****************************
  25.  
  26.     keyframe    in_ltarmup=0in_leftarm_1_1.key            local
  27.     keyframe    in_rtarmup=0in_armsout_1_1.key            local
  28.     keyframe    in_activate=in_activate_medium.key        local
  29.  
  30.     keyframe    in_pullIMP=0in_pull_imp_1_17.key        local
  31.     keyframe    in_holdIMP=0in_stand17.key                local
  32.     keyframe    in_examIMP=0in_examimp_17_17.key        local
  33.     keyframe    in_putIMP=0in_put_imp_17_1.key            local
  34.  
  35.     keyframe    yl_wave=0yl_wave_1_1.key                local
  36.     keyframe    yl_refuse=0yl_terrified_1_1.key            local
  37.     keyframe    yl_relic=0yl_arelic_1_1.key                local
  38.     keyframe    yl_taklit=0yl_taklit_1_1.key            local
  39.     keyframe    yl_thispath=0yl_followpath_1.key        local
  40.  
  41. # ***************************** MODELS ******************************
  42.         
  43.     model        mod_imp1=imp1_vibrat.3do                local
  44.     
  45. # ***************************** SOUNDS ******************************
  46.     
  47.     sound        in_here=Sw02j01.wav                        local
  48.     sound        yl_takeaway=Sw02y02.wav                    local
  49.     sound        in_whatisit=Sw02j03.wav                    local
  50.     sound        yl_terrible=Sw02y04.wav                    local
  51.     sound        in_yesmore=Sw02j05.wav                    local # 2.4s
  52.     sound        yl_taklitexpo=Sw02y06.wav                local
  53.     sound        in_pacific=Sw02j07.wav                    local
  54.     sound        yl_palawan=Sw02y08.wav                    local # 11.2s
  55.  
  56.     sound        dr_open=sea_doors_open_c.wav            local
  57.     sound        dr_close=sea_doors_close_c.wav            local
  58.  
  59. # ***************************** THINGS ******************************
  60.  
  61.     thing        player                                    local
  62.                             
  63.     thing        indy                                    linkid=0
  64.     thing        younglady                                nolink
  65.  
  66.     thing        enterdoor
  67.     thing        doorswitch
  68.     thing        exitdoor
  69.     thing        whichdoor                                local # var
  70.  
  71.     thing        cam_1                                    nolink
  72.     thing        cam_2a                                    nolink
  73.     thing        cam_2b                                    nolink
  74.     thing        cam_3                                    nolink
  75.     thing        cam_4                                    nolink
  76.     thing        cam_5                                    nolink
  77.     thing        cam_6                                    nolink
  78.     thing        cam_7                                    nolink
  79.     
  80.     thing        ct_0                                    nolink
  81.     thing        ct_1                                    nolink
  82.     thing        ct_2                                    nolink
  83.     thing        ct_3                                    nolink
  84.     thing        ct_4                                    nolink
  85.     thing        ct_5                                    nolink
  86.     thing        ct_6                                    nolink
  87.     thing        ct_7                                    nolink
  88.     thing        ct_8                                    nolink
  89.  
  90.     thing        in_mk_0                                    nolink
  91.     thing        in_mk_1                                    nolink
  92.     thing        in_mk_2                                    nolink
  93.     thing        in_mk_3                                    nolink
  94.  
  95.     thing        yl_mk_1                                    nolink
  96.  
  97.     thing        fadeplate                                nolink
  98.  
  99. # ************************ ENGINE WEIRDNESS *************************
  100.  
  101.     template    ghost_tpl=ghost                            local
  102.     
  103. # *************************** VARIABLES *****************************
  104.             
  105.     flex        duration=1.5                            local
  106.     flex        sleeptime=4.0                            local
  107.     
  108.     flex        in_rotRate                                local
  109.  
  110.     flex        youngladyCollSize                        local
  111.     flex        yl_rotRate                                local
  112.  
  113. #    flex        trackRate=0.1                            local
  114.     
  115.     int            didThisBefore=0                            local
  116.  
  117.     int            enterdooropen=0                            local
  118.     int            exitdooropen=0                            local
  119.     
  120.     int            in_swapCase=0                            local
  121.     int            in_swapRef                                local
  122.  
  123.     int            in_keyTrack1                            local
  124.  
  125.     int            youngladyCollType                        local
  126.     
  127.     int            sender                                    local
  128.     int            swapper                                    local
  129.     int            curCam                                    local
  130.     int            curSound                                local
  131.     int            curMusic                                local
  132.  
  133. # ************************* SUBROUTINES *****************************
  134.  
  135.     flex        OpenDoor                                local
  136.     flex        CloseDoor                                local
  137.  
  138. # ******************** FX COMPONENTS by McGee************************
  139.  
  140. # --------------templates-------------    
  141.     
  142.     template    ring=+ripples_vert    local
  143.     template    orb=lensflarew        local
  144.  
  145. # --------------vectors------------- 
  146.    
  147.     vector    ringstart            local  
  148.     vector    ringend                local
  149.  
  150.     vector    orbstart            local    
  151.     vector    orbend                local
  152.  
  153. # --------------variables-------------
  154.  
  155.     int        ringtrack            local
  156.     int        orbtrack            local    
  157.     int        birdloop            local    
  158.  
  159. # --------------things-------------    
  160.  
  161.     thing        ringspot        local
  162.  
  163. # --------------sound-------------    
  164.  
  165.     sound        fademagic=nub_charged_pad_c.wav            local
  166.     sound        happybirds=shw_birds.wav                local
  167.      sound        endmusic=mus_tem_tiki2int.wav            local
  168.  
  169. end
  170.  
  171. # ===================================================================
  172.  
  173. code
  174.  
  175. # ...................................................................
  176.  
  177. startup:
  178.  
  179.     # Pointer to Player
  180.     player = GetLocalPlayerThing();
  181.     
  182.     # Prep Indy...
  183.     in_rotRate = GetThingMaxRotVel(indy);
  184.  
  185.     # Prep Young Holy Woman...
  186.     SetThingFlags(younglady, 0x80000);
  187.     youngladyCollSize = GetThingCollideSize(younglady);
  188.     youngladyCollType = GetCollideType(younglady);
  189.     yl_rotRate = GetThingMaxRotVel(younglady);
  190.     
  191.     SetThingMass(younglady, 0); # no mass for the woman  cmg
  192.  
  193.     SetThingAlpha(fadeplate, 0.0);
  194.  
  195.     # set fx anim vectors
  196.     ringstart    = VectorSet(0.05, 0.05, 0.5);
  197.     ringend    = VectorSet(0.125, 0.2, 0.0);
  198.     orbstart    = VectorSet(0.05, 0.05, 0.0);
  199.     orbend    = VectorSet(0.2, 0.2, 1.0);
  200.  
  201.     return;
  202.  
  203. # ...................................................................
  204.     
  205. activated:
  206.  
  207.     sender = GetSenderRef();
  208.  
  209.     if (sender != doorswitch)
  210.     {
  211.         return;
  212.     }    
  213.     
  214.     if(didThisBefore != 0)
  215.     {
  216.         return;
  217.     }
  218.  
  219.     didThisBefore = 1;
  220.  
  221.     StartCutscene(1);
  222.  
  223.     # Prep Holy Woman...
  224.     ClearThingFlags(younglady, 0x80000);
  225.     AISetCutSceneMode(younglady);
  226.     
  227.     # Disable player...
  228.     MakeMeStop();
  229.     DeselectWeaponWait(player); # get hands free
  230.     
  231.     # Prep camera & cut to shot over Indy's shoulder...
  232.     curCam = GetCurrentCamera();
  233.     SetCameraLookInterp(2, 0); # no pan & tilt
  234.     SetCameraPosInterp(2, 0); # no dolly
  235.     SetCameraFocus(2, cam_1);
  236.     SetCameraSecondaryFocus(2, ct_0);
  237.     SetCurrentCamera(2);
  238.     SetCameraFOV(55, 0, 0.0);
  239.     Sleep(0.01);
  240.     
  241.     # Swap in our actor...
  242.     SetThingFlags(player, 0x80000); # hide player
  243.     ClearThingFlags(indy, 0x80000); # show actor
  244.     CopyPlayerHolsters(player, indy); # match props
  245.  
  246.     # Push the button...
  247.     PlayKey(indy, in_activate, 4, 0x12, 0);
  248.     Sleep(0.2);
  249.     MoveToFrame(doorswitch, 1, 1.0);
  250.     Sleep(1.0);
  251.     
  252.     # Open the door...
  253.     whichdoor = enterdoor;
  254.     call OpenDoor;
  255.  
  256.     # Pan to watch door swing open...
  257.     SetCameraLookInterp(2, 1); # enable pan & tilt
  258.     SetCameraInterpSpeed(2, 2.0);
  259.     Sleep(0.01);
  260.     SetCameraSecondaryFocus(2, ct_1);
  261.     SetCameraFOV(45, 1, 2.0);
  262.     
  263.     # Indy turns toward the opening door...
  264.     SetThingMaxRotVel(indy, 100.0); # make indy turn slowly
  265.     AISetLookThing(indy, ct_1);
  266.     AISetLookThing(younglady, indy);
  267.     
  268.     # Wait for door to finish opening...
  269.     while (enterdooropen == 0)
  270.     {
  271.          Sleep(0.01); 
  272.     }
  273.  
  274.     # Holy Woman waves to Indy...
  275.     Sleep(0.2);
  276.     PlayKey(younglady, yl_wave, 4, 0x12, 0);
  277.     Sleep(1.2);
  278.  
  279.     # Cut to Indy from courtyard...
  280.     SetCameraLookInterp(2, 0);
  281.     SetCameraFocus(2, cam_2a);
  282.     SetCameraSecondaryFocus(2, ct_2);
  283.     SetCameraFOV(45, 0, 0.0);
  284.  
  285.     # Walk Indy to Holy Woman...
  286.     SetCollideType(indy, 0);
  287.     SetCollideType(younglady, 0);
  288.     SetThingMaxRotVel(indy, in_rotRate); # reset
  289.     TeleportThing(indy, in_mk_0); # make sure Indy is correctly positioned
  290.     Sleep(0.01);
  291.     AISetMoveSpeed(indy, 1.1);
  292.     AISetLookThingEyeLevel(indy, in_mk_1);
  293.     AIEnableHeadTracking(indy, younglady);
  294.     AIEnableBodyTracking(younglady, indy);
  295.     AISetMoveThing(indy, in_mk_1, 0);
  296.     Sleep(0.01);
  297.     
  298.     # Pivot camera to follow...
  299.     MoveToFrame(ct_2, 1, 0.66); # was 0.65
  300.     Sleep(0.01);
  301.     SetCameraPosInterp(2, 1); # enable dolly mode
  302.     SetCameraInterpSpeed(2, 6.0);
  303.     SetCameraFOV(98, 1, 4.0); # was 95
  304.     SetCameraFocus(2, cam_2b);
  305.     Sleep(4.0);
  306.     AIDisableHeadTracking(indy);
  307.     AIDisableBodyTracking(younglady);
  308.     Sleep(1.2);
  309.     SetCameraFOV(68, 1, 0.8);
  310.     AIWaitForStop(indy);
  311.     
  312.     # Indy produces IMP#1...
  313.     in_keyTrack1 = PlayKey(indy, in_holdIMP, 2, 0x10, 0);
  314.     in_swapCase = 1; # swap IMP
  315.     PlayKey(indy, in_pullIMP, 4, 0x12, 0);
  316.     Sleep(0.5);
  317.     in_swapCase = 0; # keep it in hand for now
  318.     
  319.     # Indy: "Here, I guess this belongs to you."
  320.     curSound = PlayVoice(indy, in_here, 1.0, 0);
  321.     Sleep(1.0);
  322.  
  323.     # Holy Woman recoils...
  324.     PlayKey(younglady, yl_refuse, 4, 0x12, 0);
  325.     WaitForSound(curSound);
  326.     Sleep(0.5);
  327.     
  328.     # Holy Woman: "No!  Take it away!"
  329.     PlayVoice(younglady, yl_takeaway, 1.0, 1);
  330.  
  331.     # Cut to Indy over Holy Woman's shoulder...
  332.     SetCameraPosInterp(2, 0);
  333.     SetCameraFocus(2, cam_3);
  334.     SetCameraSecondaryFocus(2, ct_3);
  335.     SetCameraFOV(32, 0, 0.0);
  336.     PlayKey(indy, in_examIMP, 4, 0x12, 0);
  337.     
  338.     # Indy: "What is it, anyway?"
  339.     PlayVoice(indy, in_whatisit, 1.0, 1);
  340.     
  341.     # Holy Woman: "I don't know.  A relic."
  342.     PlayKey(younglady, yl_relic, 4, 0x12, 0);
  343.     curSound = PlayVoice(younglady, yl_terrible, 1.0, 0);
  344.     Sleep(2.0); # say part of line before cut
  345.  
  346.     # Cut to reverse shot on Holy Woman...
  347.     SetCameraFocus(2, cam_4);
  348.     SetCameraSecondaryFocus(2, ct_4);
  349.     SetCameraFOV(38, 0, 0.0);
  350.     
  351.     # Holy Woman: "You've found part of something terrible...continue?"
  352.     Sleep(0.5);
  353.     WaitForSound(curSound);
  354.  
  355.     # Cut to Indy...
  356.     SetCameraFocus(2, cam_5);
  357.     SetCameraSecondaryFocus(2, ct_5);
  358.     SetCameraFOV(30, 0, 0.0); # was 25 & before, 30
  359.     StopKey(indy, in_keyTrack1, 0.0);
  360.  
  361.     # Indy: "Yeah.  There's supposed to be more of these..."
  362.     curSound = PlayVoice(indy, in_yesmore, 1.0, 0);
  363.     in_swapCase = 2; # swap part back out
  364.     PlayKey(indy, in_putIMP, 4, 0x12, 1);
  365.     in_swapCase = 0; # no more swapping
  366.     
  367.     # Cut to Holy Woman and slowly zoom in to close-up...
  368.     SetCameraFocus(2, cam_4);
  369.     SetCameraSecondaryFocus(2, ct_6);
  370.     SetCameraFOV(48, 0, 0.0); # was 45
  371.     Sleep(0.01);
  372.     SetCameraFOV(25, 1, 10.0);
  373.     MoveToFrame(ct_6, 1, 0.1);
  374.  
  375.     # Holy Woman: "Although Urgon...Taklit...Eastern Ocean..."
  376.     WaitForSound(curSound);
  377.     curSound = PlayVoice(younglady, yl_taklitexpo, 1.0, 0);
  378.     PlayKey(younglady, yl_taklit, 4, 0x12, 0);
  379.     WaitForSound(curSound);
  380.  
  381.     # Cut to close up of Indy...
  382.     SetCameraFocus(2, cam_6);
  383.     SetCameraSecondaryFocus(2, ct_8);
  384.     SetCameraFOV(30, 0, 0.0); # was 25
  385.     
  386.     # Indy: "Are you talking about the Pacific...?"
  387.     curSound = PlayVoice(indy, in_pacific, 1.0, 0);
  388.     PlayKey(indy, in_ltarmup, 4, 0x12, 1);
  389.     PlayKey(indy, in_rtarmup, 4, 0x12, 0);
  390.     WaitForSound(curSound);
  391.     
  392.     # Back to close-up of Holy Woman...
  393.     SetCameraFocus(2, cam_7);
  394.     SetCameraSecondaryFocus(2, ct_6);
  395.     SetCameraFOV(42, 0, 0.0);
  396.     SetThingFlags(indy, 0x10); # temporarily invisible
  397.  
  398.     # Holy Woman: "Tropical Island...Palawan...follow this path!"
  399.     curSound = PlayVoice(younglady, yl_palawan, 1.0, 0);
  400.     PlayKey(younglady, yl_thispath, 4, 0x12, 0);
  401.     Sleep(10.3);
  402.  
  403.     # Some music
  404.     curMusic=PlaySoundLocal(endmusic, 1.0, 0, 0x1, 0);
  405.  
  406.     # Pan to door...
  407.     SetCameraLookInterp(2, 1); # enable pan $ tilt
  408.     SetCameraInterpSpeed(2, 3.7);
  409.     Sleep(0.01);
  410.     MoveToFrame(cam_7, 1, 0.4);
  411.     SetCameraSecondaryFocus(2, ct_7);
  412.     Sleep(0.5);
  413.  
  414.     # Open door...
  415.     whichdoor = exitdoor;
  416.     call OpenDoor;
  417.     
  418.     # springtime sounds begin
  419.     birdloop = PlaySoundLocal(happybirds, 0, 0, 0x1, 0);
  420.     ChangeSoundVol(birdloop, 0.5, 1.0);
  421.  
  422.     Sleep(1.0); # was 2.0
  423.     
  424.     # Walk Indy through the door...
  425.     ClearThingFlags(indy, 0x10); # see him again
  426.     AISetLookThingEyeLevel(indy, in_mk_2);
  427.     AISetMoveThing(indy, in_mk_2, 0);
  428.     Sleep(3.5);
  429.  
  430.     # Position Holy Woman...
  431.     CopyOrientAndPos(yl_mk_1, younglady);
  432.  
  433.     # Dolly back to see her watching Indy depart...
  434.     MoveToFrame(cam_7, 2, 0.5); # dolly back
  435.     MoveToFrame(ct_7, 1, 0.126); # tilt up
  436.     SetCameraFOV(75, 1, 8.0); # was 8.0
  437.     Sleep(1.5);
  438.  
  439.     AISetLookThing(indy, in_mk_3);
  440.     AISetMoveThing(indy, in_mk_3, 0);
  441.  
  442.     WaitForStop(cam_7);
  443.     Sleep(2.0);
  444.  
  445.     # Holy Woman vanishes...
  446.     # find the fx position 1 meter from woman's feet
  447.     ringspot=CreateThingAtPos(ghost_tpl, GetThingSector(younglady), VectorAdd(GetThingPos(younglady), '0 0 0.025'), '0 0 0');
  448.     
  449.     # set pulse speed for rings 
  450.     SetPulse(0.25);
  451.     
  452.     # Create and animate the orb
  453.     orbtrack = CreateThing(orb, ringspot);
  454.     AnimateSpriteSize(orbtrack, orbstart, orbend, 0.5);
  455.     
  456.     # play the fademagic sound
  457.     StopSound(curMusic, 2.0);
  458.     PlaySoundLocal(fademagic, 1.0, -1, 0x0, 0);
  459.     
  460.     # fade the woman
  461.     ThingFadeAnim(younglady, 1, 0, 1.0, 0);
  462.     ClearThingFlags(younglady, 0x4000);
  463.     
  464.     Sleep(1.0);
  465.     SetPulse(0);
  466.     
  467.     # diminish the orb
  468.     AnimateSpriteSize(orbtrack, orbend, orbstart, 0.5);
  469.     
  470.     # Once Indy is gone...
  471.     SetThingFlags(younglady, 0x80000);
  472.     Sleep(1.0);
  473.  
  474.     # End...
  475.     SetCameraLookInterp(2, 0);
  476.     SetCameraPosInterp(2, 0);
  477.     ThingFadeAnim(fadeplate, 0.0, 1.0, 1.0, 0);
  478.     Sleep(2.0);
  479.     EndCutscene();
  480.     StopSound(birdloop, 0.0);
  481.     JonesEndLevel();    #cmg
  482.  
  483.     # Meanwhile, temp clean up...
  484.     #DestroyThing(younglady);
  485.     #DestroyThing(indy);
  486.     #ClearThingFlags(player, 0x80000); # player in world
  487.     #ResetThing(player);
  488.     #ClearActorFlags(player, 0x200000); # restore player control
  489.     #SetCurrentCamera(curCam);
  490.     #ResetCameraFOV(0, 0.0);
  491.    
  492.     return;
  493.  
  494. # ...................................................................
  495.  
  496. arrived:
  497.  
  498.     if(GetSenderRef() == enterDoor)
  499.     {
  500.         if (enterdooropen == 0) # means door was closed
  501.         {
  502.             SetTimer(sleepTime);
  503.             enterdooropen = 1; # enterdoor is open
  504.         }
  505.         else
  506.         {
  507.             MoveToFrame(doorswitch, 0, 1.0);
  508.             enterdooropen = 0; # enterdoor is closed
  509.         }
  510.     }
  511.     
  512.     if(GetSenderRef() == exitDoor)
  513.     {
  514.         if (exitdooropen == 0) # means door was closed
  515.         {
  516.             exitdooropen = 1; # exitdoor is open
  517.         }
  518.         else
  519.         {
  520.             exitdooropen = 0; # exitdoor is closed
  521.         }
  522.     }
  523.  
  524.     return;
  525.  
  526. # ...................................................................
  527.  
  528. timer:
  529.  
  530.     call CloseDoor;
  531.  
  532.     return;
  533.  
  534. # ...................................................................
  535.  
  536. callback:
  537.  
  538.     swapper = GetSenderRef();
  539.     
  540.     if (swapper == indy)
  541.     {
  542.         if (in_swapCase == 1)
  543.         {
  544.             # Swap IMP #1 in...
  545.             in_swapRef = SetThingMesh(indy, 15, mod_imp1, 0);
  546.         }
  547.         else if (in_swapCase == 2)
  548.         {
  549.             # Get rid of the IMP
  550.             RestoreThingMesh(indy, in_swapRef);
  551.         }
  552.     }
  553.  
  554.     return;
  555.  
  556. # ...................................................................
  557.  
  558. pulse:
  559.  
  560.     ringtrack = CreateThing(ring, ringspot);
  561.     AnimateSpriteSize(ringtrack, ringstart, ringend, 0.5);
  562.  
  563.     return;
  564.     
  565. # ...................................................................
  566.  
  567. OpenDoor:
  568.  
  569.     Rotate(whichDoor, 90, 1, duration);
  570.     PlaySoundThing(dr_open, whichDoor, 1, 5, 10, 0);
  571.  
  572.     return;
  573.  
  574. # ...................................................................
  575.  
  576. CloseDoor:
  577.  
  578.     Rotate(whichDoor, -90, 1, duration);
  579.     PlaySoundThing(dr_close, whichDoor, 1, 5, 10, 0);
  580.  
  581.     return;
  582.  
  583. # ...................................................................
  584.  
  585. end
  586.